/* eslint-disable @typescript-eslint/no-explicit-any */
/*
 *  Copyright 2021 Collate
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

 /**
 * 用于编写基于 SpEL 表达式的条件的函数
 */
export interface Function {
    /**
     * 函数的描述
     */
    description?: string;
    /**
     * 函数的示例，以帮助用户编写条件
     */
    examples?: any[];
    /**
     * 函数的示例，以帮助用户编写条件中文显示
     */
    exampleShows?: any[];
    /**
     * 函数接受的输入的描述
     */
    input?: string;
    /**
     * 函数的名称
     */
    name?:                   string;
    paramAdditionalContext?: ParamAdditionalContext;
    /**
     * 邮件接收者列表
     */
    parameterInputType?: ParameterType;
    /**
     * 函数的中文名称
     */
    zhName?: string;
}

/**
 * 附加上下文
 */
export interface ParamAdditionalContext {
    /**
     * 实体列表
     */
    data?: any;
}

/**
 * 邮件接收者列表
 */
export enum ParameterType {
    AllIndexElasticSearch = "AllIndexElasticSearch",
    NotRequired = "NotRequired",
    ReadFromParamContext = "ReadFromParamContext",
    ReadFromParamContextPerEntity = "ReadFromParamContextPerEntity",
    SpecificIndexElasticSearch = "SpecificIndexElasticSearch",
}
